<template>
  <el-dialog
    title="物流服务商详情"
    :visible.sync="dialogVisible"
    width="1050px"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    custom-class="custom-class-line"
    @close="closeDialog">
    <div>
      <el-radio-group v-model="activeName" class="mb20">
        <el-radio-button label="basic">基本资料</el-radio-button>
        <el-radio-button label="address">运输线路</el-radio-button>
        <el-radio-button label="accountLog">账号日志</el-radio-button>
      </el-radio-group>
      <BasicDetail v-show="activeName === 'basic'" :userInfo="userInfo"  ref="basic"></BasicDetail>
      <AddressDetail v-show="activeName === 'address'" :data="userInfo.dept" ref="address"></AddressDetail>
      <AccountLog v-show="activeName === 'accountLog'" :data="userInfo" :active="activeName" ref="accountLog"></AccountLog>
      <div class="text-center">
        <el-button style="width:100px" @click="closeDialog">关闭</el-button>
      </div>
    </div>
  </el-dialog>
</template>

<script>
import BasicDetail from './basic/basicDetail.vue'
import AddressDetail from './address/addresssDetail.vue'
import AccountLog from './basic/accountLog.vue'
import { getByDeptIdDetail  } from "@/api/login";
export default {
  name: 'detail',
  components: {
    BasicDetail,
    AddressDetail,
    AccountLog
  },
  data() {
    return {
      dialogVisible: false,
      activeName: 'basic',
      form: {},
      userInfo: {}
    };
  },
  methods: {
    showDialog(row) {
      this.dialogVisible = true
      this.userInfo = row

      // getByDeptIdDetail(row.deptId).then(res => {
      //   console.log(res)
      //   this.form = res.data
      //   console.log(this.form)
      //   this.form.deptDistrict = String(res.data.deptDistrict)
      // });
    },
    closeDialog() {
      this.dialogVisible = false
      this.activeName = 'basic';
      this.$emit('close')
    },
  }
};
</script>
